import socket
import struct

sk=socket.socket()
sk.bind(('127.0.0.1',9001))
sk.listen()
conn,addr=sk.accept()

msg1=input('>>>>').encode('utf-8')
msg2=input('>>>>').encode('utf-8')
# num=str(len(msg1))
# ret=num.zfill(4)
# print(ret)
blen=struct.pack('i', len(msg1))#任意长度的语句，总是转换成4个字节发过去

conn.send(blen)
conn.send(msg1)
conn.send(msg2)


conn.close()
sk.close()






